package cn.anyubao.blog.enums;

/**
 * @author huqilang
 */
public enum OrderBy {

    ASC(1, "正序"),
    DESC(0, "倒序");

    private int value;
    private String desc;

    public static OrderBy toEnum(String[] tmpArr) {
        return tmpArr != null && tmpArr.length > 1 && tmpArr[1].equals(String.valueOf(ASC.value)) ? ASC : DESC;
    }

    public int getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

    private OrderBy(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }
}
